package com.soft.line.mapper;

import com.soft.line.entity.CertificateInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface CertificateInfoMapper {

    int insert(CertificateInfo certificateInfo);

    int insertRecord(CertificateInfo record);

    int delete(Map<String,Object> map);

    int update(CertificateInfo certificateInfo);

    CertificateInfo selectByPrimaryKey(Long id);

    List<CertificateInfo> selectAll(Map<String,Object> map);


    List<CertificateInfo> getPersonalAll(String userName);

    List<CertificateInfo> getAllCompanyCertificates(Map<String,Object> map);

    int countCertificateByIdAndCId(@Param("id")Integer id,@Param("certId")String certId);

    List<CertificateInfo> getAllByIdList(@Param("idList")List<Integer> idList);

    //根据年份分组查询数量
    List<Map<String, Object>> countNumGroupByYear();

    //根据部门分组查询数量
    List<Map<String, Object>> countNumGroupByCertType();

    //今年证书类型排行
    List<Map<String, Object>> certTypeRankThisYear();

}